Skip to content

feat: add Helm chart unit tests and CI validation (#8)#19

Merged
mikkeldamsgaard merged 2 commits intomainfrom
feature/helm-chart-tests-8
Feb 24, 2026
Merged

feat: add Helm chart unit tests and CI validation (#8)#19
mikkeldamsgaard merged 2 commits intomainfrom
feature/helm-chart-tests-8

Conversation

@mikkeldamsgaard
Copy link
Copy Markdown
Contributor

Summary

Add automated Helm chart tests using the helm-unittest plugin to validate template rendering and values.

Changes

New: charts/initium/tests/deployment_test.yaml

8 tests covering:

  • Disabled deployment — no resources rendered when sampleDeployment.enabled=false
  • Enabled deployment — Deployment renders with correct name, replicas, initContainers, and main container
  • SecurityContext — always applied to initContainers (runAsNonRoot, runAsUser, readOnlyRootFilesystem, capabilities drop ALL)
  • Multiple initContainers — 3 containers (wait-for, migrate, seed) render with correct names, args, and env
  • ExtraVolumes/Mounts — configMap and secret volumes included in pod spec and mounted in initContainers
  • Image config — custom repository, tag, and pullPolicy applied correctly
  • Workdir mount — custom workdir path mounted on all initContainers
  • Labels — standard Kubernetes labels present on deployment metadata

Updated: .github/workflows/ci.yml

  • Added helm plugin install helm-unittest step
  • Added helm unittest charts/initium step after existing lint and template validation

Updated: CHANGELOG.md

  • 2 entries under "Added" for helm tests and CI step

How to verify

helm unittest charts/initium

All 8 tests pass.

Closes #8

…t tests covering deployment rendering, securityContext enforcement, disabled sampleDeployment producing no resources, multiple initContainers, extraVolumes/extraVolumeMounts, image configuration, workdir mount, and labels. Add helm-unittest plugin install and run step to CI helm-lint job. Closes #8
Copilot AI review requested due to automatic review settings February 24, 2026 20:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds automated Helm chart unit testing and CI enforcement so the charts/initium deployment template behavior is validated on every PR.

Changes:

  • Add helm-unittest test suite for templates/deployment.yaml covering enable/disable behavior, initContainers rendering, securityContext, volumes/mounts, image config, workdir mounts, and labels.
  • Update GitHub Actions CI to install helm-unittest and run helm unittest charts/initium.
  • Document the new testing/CI capability in the changelog.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
charts/initium/tests/deployment_test.yaml Adds helm-unittest assertions to validate deployment template rendering across key values combinations.
.github/workflows/ci.yml Installs helm-unittest plugin and runs Helm unit tests in the existing Helm lint job.
CHANGELOG.md Notes the introduction of Helm unit tests and the CI unittest step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml Outdated
@mikkeldamsgaard mikkeldamsgaard force-pushed the feature/helm-chart-tests-8 branch from 7f1129a to 74c22c5 Compare February 24, 2026 20:39
@mikkeldamsgaard mikkeldamsgaard merged commit 2fa86bc into main Feb 24, 2026
4 checks passed
@mikkeldamsgaard mikkeldamsgaard deleted the feature/helm-chart-tests-8 branch February 26, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Helm chart tests and CI validation

2 participants